*** Stata commands for the article: REWARDING GOOD POLITICAL BEHAVIOR: US AID, DEMOCRACY, AND HUMAN RIGHTS, by Zohid Askarov, Hristos Doucouliagos, Martin Paldam, and T.D. Stanley, published in the European Journal of Political Economy.
*** The associated data is located in the file: US Aid Allocations and Democracy MRA August 5 2021.dta

*** The following command creates Figure 1. US Aid Allocations and Political Rights
twoway (scatter Precision PartialCorrelationr if DonorUSonly1yes ==1 & HumanRights1yes == 0, ytitle("Precision (1/SE)") legend(off)) (scatter Precision PartialCorrelationr if DonorUSonly1yes ==1 & HumanRights1yes == 1, ytitle("Precision (1/SE)") legend(off))

*** Descriptive statistics
sum PartialCorrelationr if DonorUSonly1yes ==1
sum PartialCorrelationr if DonorUSonly1yes ==1 & HumanRights1yes == 0 
sum PartialCorrelationr if DonorUSonly1yes ==1 & HumanRights1yes == 1 
reg PartialCorrelationr if DonorUSonly1yes ==1 & HumanRights1yes == 0 [aweight = PrecisionSqr] , cluster(StudyID)
reg PartialCorrelationr if DonorUSonly1yes ==1 & HumanRights1yes == 1 [aweight = PrecisionSqr] , cluster(StudyID)

*** The following commands will reproduce Table 1. US Aid and Recipient Behavior (Dependent variable = partial correlations)
** Row(1)Baseline 
reg PartialCorrelationr SEforr Unpublished HumanRights1yes PerCapitaAid AidShares AidGDP disbursements AverageYearrelativeto1990 Panel DonorCommercialNeeds MilitaryPoliticalDependency RecipientNeedsHumanitarian  Bureaucracylagdependentvaria recipientortimefixedeffects demhouseshare100 focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit if DonorUSonly1yes ==1 [aweight = PrecisionSqr], cluster( StudyID)
display e(r2_a)
** Row(2) Publication year fixed effects
reg PartialCorrelationr SEforr Unpublished HumanRights1yes PerCapitaAid AidShares AidGDP disbursements AverageYearrelativeto1990 Panel DonorCommercialNeeds MilitaryPoliticalDependency RecipientNeedsHumanitarian  Bureaucracylagdependentvaria recipientortimefixedeffects demhouseshare100 focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit i.PublicationYear if DonorUSonly1yes ==1 [aweight = PrecisionSqr], cluster( StudyID)
display e(r2_a)
** Row(3) Administration dummies
reg PartialCorrelationr SEforr Unpublished HumanRights1yes PerCapitaAid AidShares AidGDP disbursements AverageYearrelativeto1990 Panel DonorCommercialNeeds MilitaryPoliticalDependency RecipientNeedsHumanitarian  Bureaucracylagdependentvaria recipientortimefixedeffects demhouseshare100 focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit Nixon196974 Ford197477 CarterAdmin19771981 ReagenAdmin198189January BushI198993 Clinton19932001 BushW20012009 Obama2009 if DonorUSonly1yes ==1 [aweight = PrecisionSqr], cluster( StudyID)
display e(r2_a)
** Row(4) Specific model 
reg PartialCorrelationr HumanRights1yes PerCapitaAid AidShares disbursements AverageYearrelativeto1990 Panel RecipientNeedsHumanitarian demhouseshare focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit i.PublicationYear  if DonorUSonly1yes ==1 [aweight = PrecisionSqr], cluster( StudyID)
display e(r2_a)
*** Row(5) WALS model averaging (note that Precision here gives the constant and the constant gives the coefficient on SEforr)
wals tstatUS time1-time29 Precision HumanRightsSE, auxiliary(RecipientNeedsHumanitarianSE demhouseshareSE AveYearSE UnpublishedSE PerCapitaAidSE AidSharesSE AidGDPSE FixedSE InertiaSE PanelSE DonorCommercialNeedsSE MilitaryPoliticalSE focusondemocracySE TwoStepAnalysis1yesSE disbursementsSE dataaverageSE TobitSE )


*** ROBUSTNESS checks, reported in the Online Appendix
*** Table A4. Robustness Checks. Explaining partial correlations
*** Row (2) Congress score
reg PartialCorrelationr SEforr Unpublished HumanRights1yes PerCapitaAid AidShares AidGDP disbursements AverageYearrelativeto1990 Panel DonorCommercialNeeds MilitaryPoliticalDependency RecipientNeedsHumanitarian  Bureaucracylagdependentvaria recipientortimefixedeffects congressscore focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit i.PublicationYear if DonorUSonly1yes ==1 [aweight = PrecisionSqr], cluster( StudyID)
display e(r2_a)
*** Row (3) Author ids
reg PartialCorrelationr SEforr Unpublished HumanRights1yes PerCapitaAid AidShares AidGDP disbursements AverageYearrelativeto1990 Panel DonorCommercialNeeds MilitaryPoliticalDependency RecipientNeedsHumanitarian  Bureaucracylagdependentvaria recipientortimefixedeffects demhouseshare focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit i.PublicationYear if DonorUSonly1yes ==1 [aweight = PrecisionSqr], cluster( authorID)
display e(r2_a)
*** Row (4) Sample size weights
reg PartialCorrelationr SEforr Unpublished HumanRights1yes PerCapitaAid AidShares AidGDP disbursements AverageYearrelativeto1990 Panel DonorCommercialNeeds MilitaryPoliticalDependency RecipientNeedsHumanitarian  Bureaucracylagdependentvaria recipientortimefixedeffects demhouseshare focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit i.PublicationYear if DonorUSonly1yes ==1 [aweight = Observations], cluster( StudyID)
display e(r2_a)
*** Row (5) no negative correlations
reg PartialCorrelationr SEforr Unpublished HumanRights1yes PerCapitaAid AidShares AidGDP disbursements AverageYearrelativeto1990 Panel DonorCommercialNeeds MilitaryPoliticalDependency RecipientNeedsHumanitarian  Bureaucracylagdependentvaria recipientortimefixedeffects demhouseshare focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit i.PublicationYear if DonorUSonly1yes ==1 & PartialCorrelationr >=0 [aweight = PrecisionSqr], cluster( StudyID)
display e(r2_a)
*** Row (6) no outliers
reg PartialCorrelationr SEforr Unpublished HumanRights1yes PerCapitaAid AidShares AidGDP disbursements AverageYearrelativeto1990 Panel DonorCommercialNeeds MilitaryPoliticalDependency RecipientNeedsHumanitarian  Bureaucracylagdependentvaria recipientortimefixedeffects demhouseshare focusondemocracy  TwoStepAnalysis1yes dataaveraging Tobit i.PublicationYear if DonorUSonly1yes ==1 & abs(estaALL) < 2.5 [aweight = PrecisionSqr], cluster( StudyID)
display e(r2_a)

*** DATA TRANSFORMATIONS
** inverse variance weights
gen PrecisionSqr = Precision^2
** Democrat control of the House
gen demhouseshare100 = demhouseshare*100
** Generate variables for WALS estimates, transformed for inverse variance weights
gen UnpublishedSE = Unpublished/SEforr
gen HumanRightsSE = HumanRights1yes/SEforr
gen AidGDPSE =  AidGDP/ SEforr
gen focusondemocracySE = focusondemocracy/SEforr
gen PerCapitaAidSE = PerCapitaAid/SEforr
gen TwoStepAnalysis1yesSE = TwoStepAnalysis1yes/SEforr
gen disbursementsSE = disbursements/SEforr  
gen AidSharesSE = AidShares/SEforr
gen AveYearSE = AverageYearrelativeto1990/SEforr
gen RecipientNeedsHumanitarianSE =  RecipientNeedsHumanitarian/SEforr
gen InertiaSE =  Bureaucracylagdependentvaria /SEforr
gen NixonSE = Nixon196974/SEforr
gen CarterSE = CarterAdmin19771981/SEforr
gen BushSE = BushI198993/SEforr
gen demhouseshareSE = demhouseshare/SEforr
gen PanelSE = Panel/SEforr
gen DonorCommercialNeedsSE = DonorCommercialNeeds/SEforr
gen MilitaryPoliticalSE = MilitaryPoliticalDependency/SEforr  
gen Ford197477SE = Ford197477/SEforr  
gen ReagenAdminSE = ReagenAdmin198189January/SEforr  
gen ClintonSE = Clinton19932001/SEforr  
gen BushWSE = BushW20012009 /SEforr  
gen Obama2009SE = Obama2009 /SEforr  
gen NonOLSSE = NonOLSused/SEforr  
gen time1SE = time1/SEforr  
gen time2SE = time2/SEforr  
gen time3SE = time3/SEforr  
gen time4SE = time4/SEforr  
gen time5SE = time5/SEforr  
gen time6SE = time6/SEforr  
gen time7SE = time7/SEforr  
gen time8SE = time8/SEforr  
gen time9SE = time9/SEforr  
gen time10SE = time10/SEforr  
gen time11SE = time11/SEforr  
gen time12SE = time12/SEforr  
gen time13SE = time13/SEforr  
gen time14SE = time14/SEforr  
gen time15SE = time15/SEforr  
gen time16SE = time16/SEforr  
gen time17SE = time17/SEforr  
gen time18SE = time18/SEforr  
gen time19SE = time19/SEforr  
gen time20SE = time20/SEforr  
gen time21SE = time21/SEforr  
gen time22SE = time22/SEforr  
gen time23SE = time23/SEforr  
gen time24SE = time24/SEforr  
gen time25SE = time25/SEforr  
gen time26SE = time26/SEforr  
gen time27SE = time27/SEforr  
gen time28SE = time28/SEforr  
gen time29SE = time29/SEforr  
gen dataaverageSE = dataaveraging/SEforr  
gen TobitSE = Tobit/SEforr
gen FixedSE = recipientortimefixedeffects/SEforr
  
*** elasticities
reg Elasticity if DonorUSonly1yes ==1 & HumanRights1yes !=1, cluster( StudyID )
reg Elasticity if DonorUSonly1yes ==1 & HumanRights1yes !=1 [aweight = precision2] , cluster( StudyID )

*** Identification of outliers
reg tstat Precision if DonorUSonly1yes ==1 
predict estaALL if e(sample), rstandard
sum estaALL if abs(estaALL) > 2.5
twoway (scatter Precision PartialCorrelationr if abs(estaALL) < 2.5 & DonorUSonly1yes ==1 & HumanRights1yes == 0 & StudyID != 138 & sectoralaid !=1) (scatter Precision PartialCorrelationr if abs(estaALL) < 2.5 & DonorUSonly1yes ==1 & HumanRights1yes == 1 & StudyID != 138 & sectoralaid !=1)


